<script>
	$(function () {
        $('#id_tree_pannel_left').before('<span>评价部门查询</span>');

		layui.extend({
			dtree: '{/}/static/plugins/layui/extends/dtree/dtree'   // {/}的意思即代表采用自有路径，即不跟随 base 路径
		}).use(['dtree','layer','jquery'], function(){
			var dtree = layui.dtree, layer = layui.layer, $ = layui.jquery;
			
			// 初始化树
			var DemoTree = dtree.render({
				elem: "#id_tree",
				url: '/api/inter/tsUserInfo/dtree',
				initLevel: "2",
				toolbar:true,
				toolbarWay:"follow",
				toolbarShow:[],
				width:'100%',
				menubar:true,
				menubarTips:{
                        group:["refresh"]
				},
			});
			
			// 绑定节点点击
			dtree.on("node('id_tree')" ,function(obj){
				var objd = obj.param;
				console.log('objd',objd);
				layui.table.reload("main_table",{
					page: {
						curr: 1 //重新从第 1 页开始
					},
					where: {
                        guidTsOrganizationInfo: objd.nodeId
					}
				})
				return;
			});
		});
	});
</script>